"""change agent level app/function acl

Revision ID: 28702a5576f5
Revises: 70dd635d80d4
Create Date: 2025-03-10 23:39:42.611170+00:00

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = '28702a5576f5'
down_revision: Union[str, None] = '70dd635d80d4'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('agents', sa.Column('allowed_apps', postgresql.ARRAY(sa.String(length=255)), nullable=False))
    op.drop_column('agents', 'excluded_apps')
    op.drop_column('agents', 'excluded_functions')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('agents', sa.Column('excluded_functions', postgresql.ARRAY(sa.VARCHAR(length=255)), autoincrement=False, nullable=False))
    op.add_column('agents', sa.Column('excluded_apps', postgresql.ARRAY(sa.VARCHAR(length=255)), autoincrement=False, nullable=False))
    op.drop_column('agents', 'allowed_apps')
    # ### end Alembic commands ###
